#ifndef LUA_HELPER_H_INCLUDED
#define LUA_HELPER_H_INCLUDED

#define DEBUG true

#define REG(STR) \
	lua_register(P.L, #STR, STR);

#define isnum(i) \
	lua_isnumber(l,i)

#define tonum(i) \
	lua_tonumber(l,i)

#define isstr(i) \
	lua_isstring(l,i)

#define tostr(i) \
	lua_tostring(l,i)

#define isbool(i) \
	lua_isboolean(l,i)

#define tobool(i) \
	lua_toboolean(l,i)

#define isfunc(i) \
	lua_isfunction(l,i)

enum {
	EVERY_FRAME = 0,
};

enum {
	AT_FLYSTRAIGHT = 0,
	AT_FLYCIRCLE,
	AT_ROTATOR,
};

typedef unsigned int uint;

int LOG_ERROR(const char* msg, const int errorcode = -1) {
	if (DEBUG)
		printf("%s\n", msg);
	return errorcode;
}

#endif // LUA_HELPER_H_INCLUDED
